package com.construction.api.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Objects;

/**
 * @author dybin
 * @Date: 2021/7/2 23:15
 */
@Getter
@AllArgsConstructor
public enum RoleEnum {

    ADMIN(1, "超级管理员"),
    GYS(3, "供应商管理员"),
    PROJECT(5, "项目管理员");

    private final Integer roleId;
    private final String msg;

    public static RoleEnum of(Integer roleId) {
        return Arrays.stream(RoleEnum.values()).filter(it -> Objects.equals(it.getRoleId(), roleId)).findFirst().orElse(null);
    }

}
